# 阶乘
def factorial(n):
    r = n
    for i in range(n-1):
        print(i + 1)
        r *= (i + 1)
    return r


print(factorial(5))

